package com.ashley.thread.test2;

public class MyThread extends Thread{

	@Override
	public void run() {
		long start = System.currentTimeMillis();
		try {
			for (int i = 0; i < 10; i++) {
				System.out.println(Thread.currentThread().getName() + ":"+System.currentTimeMillis());
				 int time =  (int) (Math.random() * 1000);
				 Thread.sleep(time);
			}
		} catch (Exception e) {
			// TODO: handle exception
		}
		long end = System.currentTimeMillis();
		System.out.println(Thread.currentThread().getName() + ":"+ (end - start) + "ms");
	}
}
